package org.fujay.langchain4jserver.application.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 知识库索引状态 DTO
 */
@Data
@NoArgsConstructor
public class KnowledgeBaseIndexStatusDTO {

    private Long knowledgeBaseId;
    private String knowledgeBaseStatus;
    private int totalFiles;
    private int pendingFiles;
    private int processingFiles; // 解析中、向量化中、存储中
    private int completedFiles;
    private int failedFiles;
    private List<FailedFileDetailDTO> failedFilesDetails; // 最近失败的文件列表

    /**
     * 失败文件详情内部类 DTO
     */
    @Data
    @NoArgsConstructor
    public static class FailedFileDetailDTO {
        private Long fileId;
        private String fileName;
        private String errorMessage;

        public FailedFileDetailDTO(Long fileId, String fileName, String errorMessage) {
            this.fileId = fileId;
            this.fileName = fileName;
            this.errorMessage = errorMessage;
        }
    }
}
